package com.mob.commons.appcollector;

import android.content.Context;
import android.os.Build.VERSION;
import com.mob.commons.a;
import com.mob.commons.g;
import com.mob.tools.MobLog;
import com.mob.tools.log.NLog;
import com.mob.tools.utils.DeviceHelper;
import com.mob.tools.utils.R;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

public class RuntimeCollector
{
  private static final String a;
  private static RuntimeCollector b;
  private Context c;
  private DeviceHelper d;

  static
  {
    if (Build.VERSION.SDK_INT >= 16);
    for (String str = "^u\\d+_a\\d+"; ; str = "^app_\\d+")
    {
      a = str;
      return;
    }
  }

  private RuntimeCollector(Context paramContext)
  {
    this.c = paramContext.getApplicationContext();
    this.d = DeviceHelper.getInstance(paramContext);
  }

  private ArrayList<HashMap<String, Object>> a(HashMap<String, String>[][] paramArrayOfHashMap, ArrayList<long[]> paramArrayList)
  {
    ArrayList localArrayList = new ArrayList(paramArrayOfHashMap.length);
    for (int i = 0; i < paramArrayOfHashMap.length; i++)
    {
      HashMap localHashMap = new HashMap();
      localHashMap.put("runtimes", Long.valueOf(0L));
      localHashMap.put("fg", Integer.valueOf(0));
      localHashMap.put("bg", Integer.valueOf(0));
      localHashMap.put("empty", Integer.valueOf(0));
      localArrayList.add(localHashMap);
      HashMap<String, String>[] arrayOfHashMap = paramArrayOfHashMap[i];
      int j = -1 + arrayOfHashMap.length;
      if (j >= 0)
      {
        long l2;
        if (arrayOfHashMap[j] != null)
        {
          long l1 = ((Long)R.forceCast(localHashMap.get("runtimes"), Long.valueOf(0L))).longValue();
          if (j != 0)
            break label267;
          l2 = 0L;
          label140: localHashMap.put("runtimes", Long.valueOf(l2 + l1));
          if (!"fg".equals(arrayOfHashMap[j].get("pcy")))
            break label283;
          localHashMap.put("fg", Integer.valueOf(1 + ((Integer)R.forceCast(localHashMap.get("fg"), Integer.valueOf(0))).intValue()));
        }
        while (true)
        {
          localHashMap.put("pkg", arrayOfHashMap[j].get("pkg"));
          localHashMap.put("name", arrayOfHashMap[j].get("name"));
          localHashMap.put("version", arrayOfHashMap[j].get("version"));
          j--;
          break;
          label267: l2 = ((long[])paramArrayList.get(j))[1];
          break label140;
          label283: if ("bg".equals(arrayOfHashMap[j].get("pcy")))
            localHashMap.put("bg", Integer.valueOf(1 + ((Integer)R.forceCast(localHashMap.get("bg"), Integer.valueOf(0))).intValue()));
          else
            localHashMap.put("empty", Integer.valueOf(1 + ((Integer)R.forceCast(localHashMap.get("empty"), Integer.valueOf(0))).intValue()));
        }
      }
    }
    return localArrayList;
  }

  private HashMap<String, Integer> a(ArrayList<ArrayList<HashMap<String, String>>> paramArrayList)
  {
    HashMap localHashMap1 = new HashMap();
    Iterator localIterator1 = paramArrayList.iterator();
    int j;
    for (int i = 0; localIterator1.hasNext(); i = j)
    {
      Iterator localIterator2 = ((ArrayList)localIterator1.next()).iterator();
      j = i;
      while (localIterator2.hasNext())
      {
        HashMap localHashMap2 = (HashMap)localIterator2.next();
        String str = (String)localHashMap2.get("pkg") + ":" + (String)localHashMap2.get("version");
        if (!localHashMap1.containsKey(str))
        {
          localHashMap1.put(str, Integer.valueOf(j));
          j++;
        }
      }
    }
    return localHashMap1;
  }

  private void a()
  {
    e locale = new e(this);
    locale.setPriority(1);
    locale.start();
  }

  // ERROR //
  private void a(String paramString, ArrayList<ArrayList<HashMap<String, String>>> paramArrayList, ArrayList<long[]> paramArrayList1)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokespecial 169	com/mob/commons/appcollector/RuntimeCollector:e	()Ljava/util/HashMap;
    //   4: astore 6
    //   6: new 171	java/io/BufferedReader
    //   9: dup
    //   10: new 173	java/io/InputStreamReader
    //   13: dup
    //   14: new 175	java/io/FileInputStream
    //   17: dup
    //   18: aload_1
    //   19: invokespecial 178	java/io/FileInputStream:<init>	(Ljava/lang/String;)V
    //   22: ldc 180
    //   24: invokespecial 183	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   27: invokespecial 186	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   30: astore 7
    //   32: aload 7
    //   34: invokevirtual 189	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   37: astore 8
    //   39: iconst_0
    //   40: istore 9
    //   42: iload 9
    //   44: bipush 7
    //   46: if_icmpge +16 -> 62
    //   49: aload 7
    //   51: invokevirtual 189	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   54: astore 8
    //   56: iinc 9 1
    //   59: goto -17 -> 42
    //   62: new 50	java/util/ArrayList
    //   65: dup
    //   66: invokespecial 190	java/util/ArrayList:<init>	()V
    //   69: astore 10
    //   71: aload 8
    //   73: ifnull +135 -> 208
    //   76: ldc 192
    //   78: aload 8
    //   80: invokevirtual 103	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   83: ifeq +97 -> 180
    //   86: aload 7
    //   88: invokevirtual 189	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   91: astore 11
    //   93: aload 11
    //   95: ldc 194
    //   97: invokevirtual 198	java/lang/String:split	(Ljava/lang/String;)[Ljava/lang/String;
    //   100: astore 15
    //   102: iconst_2
    //   103: newarray long
    //   105: astore 16
    //   107: aload 16
    //   109: iconst_0
    //   110: aload 15
    //   112: iconst_0
    //   113: aaload
    //   114: invokestatic 201	java/lang/Long:valueOf	(Ljava/lang/String;)Ljava/lang/Long;
    //   117: invokevirtual 96	java/lang/Long:longValue	()J
    //   120: lastore
    //   121: aload 16
    //   123: iconst_1
    //   124: aload 15
    //   126: iconst_1
    //   127: aaload
    //   128: invokestatic 201	java/lang/Long:valueOf	(Ljava/lang/String;)Ljava/lang/Long;
    //   131: invokevirtual 96	java/lang/Long:longValue	()J
    //   134: lastore
    //   135: aload_2
    //   136: aload 10
    //   138: invokevirtual 83	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   141: pop
    //   142: aload_3
    //   143: aload 16
    //   145: invokevirtual 83	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   148: pop
    //   149: new 50	java/util/ArrayList
    //   152: dup
    //   153: invokespecial 190	java/util/ArrayList:<init>	()V
    //   156: astore 10
    //   158: iconst_0
    //   159: istore 13
    //   161: iload 13
    //   163: bipush 7
    //   165: if_icmpge +33 -> 198
    //   168: aload 7
    //   170: invokevirtual 189	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   173: pop
    //   174: iinc 13 1
    //   177: goto -16 -> 161
    //   180: aload 8
    //   182: invokevirtual 204	java/lang/String:length	()I
    //   185: ifle +13 -> 198
    //   188: aload_0
    //   189: aload 8
    //   191: aload 6
    //   193: aload 10
    //   195: invokespecial 207	com/mob/commons/appcollector/RuntimeCollector:a	(Ljava/lang/String;Ljava/util/HashMap;Ljava/util/ArrayList;)V
    //   198: aload 7
    //   200: invokevirtual 189	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   203: astore 8
    //   205: goto -134 -> 71
    //   208: aload 7
    //   210: invokevirtual 210	java/io/BufferedReader:close	()V
    //   213: return
    //   214: astore 4
    //   216: invokestatic 215	com/mob/tools/MobLog:getInstance	()Lcom/mob/tools/log/NLog;
    //   219: aload 4
    //   221: invokevirtual 220	com/mob/tools/log/NLog:d	(Ljava/lang/Throwable;)I
    //   224: pop
    //   225: return
    //   226: astore 12
    //   228: goto -79 -> 149
    //
    // Exception table:
    //   from	to	target	type
    //   0	39	214	java/lang/Throwable
    //   49	56	214	java/lang/Throwable
    //   62	71	214	java/lang/Throwable
    //   76	93	214	java/lang/Throwable
    //   149	158	214	java/lang/Throwable
    //   168	174	214	java/lang/Throwable
    //   180	198	214	java/lang/Throwable
    //   198	205	214	java/lang/Throwable
    //   208	213	214	java/lang/Throwable
    //   93	149	226	java/lang/Throwable
  }

  private void a(String paramString, HashMap<String, String[]> paramHashMap, ArrayList<HashMap<String, String>> paramArrayList)
  {
    String[] arrayOfString1 = paramString.replaceAll(" +", " ").split(" ");
    if ((arrayOfString1 != null) && (arrayOfString1.length >= 10))
    {
      String str = arrayOfString1[(-1 + arrayOfString1.length)];
      if ((arrayOfString1[(-2 + arrayOfString1.length)].matches(a)) && (!"top".equals(str)))
      {
        String[] arrayOfString2 = (String[])paramHashMap.get(str);
        if (arrayOfString2 != null)
        {
          HashMap localHashMap = new HashMap();
          localHashMap.put("pkg", str);
          localHashMap.put("name", arrayOfString2[0]);
          localHashMap.put("version", arrayOfString2[1]);
          localHashMap.put("pcy", arrayOfString1[(-3 + arrayOfString1.length)]);
          paramArrayList.add(localHashMap);
        }
      }
    }
  }

  private void a(ArrayList<HashMap<String, Object>> paramArrayList, ArrayList<long[]> paramArrayList1)
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("type", "APP_RUNTIMES");
    localHashMap.put("list", paramArrayList);
    localHashMap.put("datatime", Long.valueOf(a.b(this.c)));
    localHashMap.put("recordat", Long.valueOf(((long[])paramArrayList1.get(0))[0]));
    long l = 0L;
    for (int i = 1; i < paramArrayList1.size(); i++)
      l += ((long[])paramArrayList1.get(i))[1];
    localHashMap.put("sdk_runtime_len", Long.valueOf(l));
    localHashMap.put("top_count", Integer.valueOf(paramArrayList1.size()));
    g.a(this.c).a(localHashMap);
  }

  private boolean a(String paramString)
  {
    ArrayList localArrayList1 = new ArrayList();
    ArrayList localArrayList2 = new ArrayList();
    a(paramString, localArrayList1, localArrayList2);
    a(a(a(a(localArrayList1), localArrayList1), localArrayList2), localArrayList2);
    return b(paramString);
  }

  private HashMap<String, String>[][] a(HashMap<String, Integer> paramHashMap, ArrayList<ArrayList<HashMap<String, String>>> paramArrayList)
  {
    HashMap[][] arrayOfHashMap = (HashMap[][])Array.newInstance(HashMap.class, new int[] { paramHashMap.size(), paramArrayList.size() });
    int i = paramArrayList.size();
    for (int j = 0; j < i; j++)
    {
      ArrayList localArrayList = (ArrayList)paramArrayList.get(j);
      int k = localArrayList.size();
      for (int m = 0; m < k; m++)
      {
        HashMap localHashMap = (HashMap)localArrayList.get(m);
        arrayOfHashMap[((Integer)paramHashMap.get((String)localHashMap.get("pkg") + ":" + (String)localHashMap.get("version"))).intValue()][j] = localHashMap;
      }
    }
    return arrayOfHashMap;
  }

  // ERROR //
  private void b()
  {
    // Byte code:
    //   0: new 291	java/io/File
    //   3: dup
    //   4: aload_0
    //   5: getfield 38	com/mob/commons/appcollector/RuntimeCollector:c	Landroid/content/Context;
    //   8: invokestatic 295	com/mob/tools/utils/R:getCacheRoot	(Landroid/content/Context;)Ljava/lang/String;
    //   11: ldc_w 297
    //   14: invokespecial 300	java/io/File:<init>	(Ljava/lang/String;Ljava/lang/String;)V
    //   17: astore_1
    //   18: aload_1
    //   19: invokevirtual 304	java/io/File:getParentFile	()Ljava/io/File;
    //   22: invokevirtual 307	java/io/File:exists	()Z
    //   25: ifne +11 -> 36
    //   28: aload_1
    //   29: invokevirtual 304	java/io/File:getParentFile	()Ljava/io/File;
    //   32: invokevirtual 310	java/io/File:mkdirs	()Z
    //   35: pop
    //   36: aload_1
    //   37: invokevirtual 313	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   40: astore_3
    //   41: aload_0
    //   42: invokespecial 315	com/mob/commons/appcollector/RuntimeCollector:c	()J
    //   45: lstore 4
    //   47: invokestatic 321	java/lang/Runtime:getRuntime	()Ljava/lang/Runtime;
    //   50: ldc_w 323
    //   53: invokevirtual 327	java/lang/Runtime:exec	(Ljava/lang/String;)Ljava/lang/Process;
    //   56: astore 6
    //   58: aload 6
    //   60: invokevirtual 333	java/lang/Process:getOutputStream	()Ljava/io/OutputStream;
    //   63: astore 7
    //   65: iconst_1
    //   66: istore 8
    //   68: lload 4
    //   70: lstore 9
    //   72: aload 7
    //   74: astore 11
    //   76: aload 6
    //   78: astore 12
    //   80: aload_0
    //   81: getfield 38	com/mob/commons/appcollector/RuntimeCollector:c	Landroid/content/Context;
    //   84: invokestatic 336	com/mob/commons/a:c	(Landroid/content/Context;)Z
    //   87: ifeq +460 -> 547
    //   90: aload_1
    //   91: invokevirtual 307	java/io/File:exists	()Z
    //   94: ifne +8 -> 102
    //   97: aload_1
    //   98: invokevirtual 339	java/io/File:createNewFile	()Z
    //   101: pop
    //   102: aload_0
    //   103: getfield 38	com/mob/commons/appcollector/RuntimeCollector:c	Landroid/content/Context;
    //   106: invokestatic 250	com/mob/commons/a:b	(Landroid/content/Context;)J
    //   109: lstore 27
    //   111: aload 11
    //   113: new 135	java/lang/StringBuilder
    //   116: dup
    //   117: invokespecial 136	java/lang/StringBuilder:<init>	()V
    //   120: ldc_w 341
    //   123: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   126: aload_3
    //   127: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   130: ldc_w 343
    //   133: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   136: ldc 192
    //   138: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   141: ldc_w 345
    //   144: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   147: aload_3
    //   148: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   151: ldc_w 347
    //   154: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   157: invokevirtual 146	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   160: ldc_w 349
    //   163: invokevirtual 353	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   166: invokevirtual 359	java/io/OutputStream:write	([B)V
    //   169: iload 8
    //   171: ifeq +206 -> 377
    //   174: new 135	java/lang/StringBuilder
    //   177: dup
    //   178: invokespecial 136	java/lang/StringBuilder:<init>	()V
    //   181: ldc_w 361
    //   184: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   187: lload 27
    //   189: invokevirtual 364	java/lang/StringBuilder:append	(J)Ljava/lang/StringBuilder;
    //   192: ldc_w 366
    //   195: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   198: aload_3
    //   199: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   202: ldc_w 347
    //   205: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   208: invokevirtual 146	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   211: astore 29
    //   213: iconst_0
    //   214: istore 8
    //   216: aload 11
    //   218: aload 29
    //   220: ldc_w 349
    //   223: invokevirtual 353	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   226: invokevirtual 359	java/io/OutputStream:write	([B)V
    //   229: aload 11
    //   231: invokevirtual 369	java/io/OutputStream:flush	()V
    //   234: lload 27
    //   236: lload 9
    //   238: lcmp
    //   239: iflt +308 -> 547
    //   242: aload 11
    //   244: ldc_w 371
    //   247: ldc_w 349
    //   250: invokevirtual 353	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   253: invokevirtual 359	java/io/OutputStream:write	([B)V
    //   256: aload 11
    //   258: invokevirtual 369	java/io/OutputStream:flush	()V
    //   261: aload 11
    //   263: invokevirtual 372	java/io/OutputStream:close	()V
    //   266: aload 12
    //   268: invokevirtual 375	java/lang/Process:waitFor	()I
    //   271: pop
    //   272: aload 12
    //   274: invokevirtual 378	java/lang/Process:destroy	()V
    //   277: aload_0
    //   278: aload_3
    //   279: invokespecial 380	com/mob/commons/appcollector/RuntimeCollector:a	(Ljava/lang/String;)Z
    //   282: ifeq +258 -> 540
    //   285: aload_0
    //   286: invokespecial 382	com/mob/commons/appcollector/RuntimeCollector:d	()J
    //   289: lstore 35
    //   291: lload 35
    //   293: lstore 37
    //   295: lload 37
    //   297: lconst_0
    //   298: lcmp
    //   299: ifle +234 -> 533
    //   302: lload 37
    //   304: lstore 31
    //   306: iconst_1
    //   307: istore 8
    //   309: invokestatic 321	java/lang/Runtime:getRuntime	()Ljava/lang/Runtime;
    //   312: ldc_w 323
    //   315: invokevirtual 327	java/lang/Runtime:exec	(Ljava/lang/String;)Ljava/lang/Process;
    //   318: astore 33
    //   320: aload 33
    //   322: invokevirtual 333	java/lang/Process:getOutputStream	()Ljava/io/OutputStream;
    //   325: astore 34
    //   327: aload 33
    //   329: astore 19
    //   331: aload 34
    //   333: astore 18
    //   335: lload 31
    //   337: lstore 16
    //   339: sipush 1000
    //   342: aload_0
    //   343: getfield 38	com/mob/commons/appcollector/RuntimeCollector:c	Landroid/content/Context;
    //   346: invokestatic 385	com/mob/commons/a:d	(Landroid/content/Context;)I
    //   349: imul
    //   350: i2l
    //   351: invokestatic 389	java/lang/Thread:sleep	(J)V
    //   354: aload 18
    //   356: astore 25
    //   358: aload 19
    //   360: astore 26
    //   362: lload 16
    //   364: lstore 9
    //   366: aload 25
    //   368: astore 11
    //   370: aload 26
    //   372: astore 12
    //   374: goto -294 -> 80
    //   377: new 135	java/lang/StringBuilder
    //   380: dup
    //   381: invokespecial 136	java/lang/StringBuilder:<init>	()V
    //   384: ldc_w 361
    //   387: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   390: lload 27
    //   392: invokevirtual 364	java/lang/StringBuilder:append	(J)Ljava/lang/StringBuilder;
    //   395: ldc 194
    //   397: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   400: aload_0
    //   401: getfield 38	com/mob/commons/appcollector/RuntimeCollector:c	Landroid/content/Context;
    //   404: invokestatic 385	com/mob/commons/a:d	(Landroid/content/Context;)I
    //   407: invokevirtual 392	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   410: ldc_w 345
    //   413: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   416: aload_3
    //   417: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   420: ldc_w 347
    //   423: invokevirtual 140	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   426: invokevirtual 146	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   429: astore 39
    //   431: aload 39
    //   433: astore 29
    //   435: goto -219 -> 216
    //   438: astore 13
    //   440: aload 11
    //   442: astore 14
    //   444: aload 12
    //   446: astore 15
    //   448: lload 9
    //   450: lstore 16
    //   452: aload 14
    //   454: astore 18
    //   456: aload 15
    //   458: astore 19
    //   460: invokestatic 215	com/mob/tools/MobLog:getInstance	()Lcom/mob/tools/log/NLog;
    //   463: aload 13
    //   465: invokevirtual 220	com/mob/tools/log/NLog:d	(Ljava/lang/Throwable;)I
    //   468: pop
    //   469: aload 18
    //   471: astore 21
    //   473: aload 19
    //   475: astore 22
    //   477: lload 16
    //   479: lstore 9
    //   481: aload 21
    //   483: astore 11
    //   485: aload 22
    //   487: astore 12
    //   489: goto -409 -> 80
    //   492: astore_2
    //   493: return
    //   494: astore 13
    //   496: aload 11
    //   498: astore 18
    //   500: aload 12
    //   502: astore 19
    //   504: lload 31
    //   506: lstore 16
    //   508: goto -48 -> 460
    //   511: astore 13
    //   513: aload 33
    //   515: astore 19
    //   517: aload 11
    //   519: astore 18
    //   521: lload 31
    //   523: lstore 16
    //   525: goto -65 -> 460
    //   528: astore 13
    //   530: goto -70 -> 460
    //   533: lload 9
    //   535: lstore 37
    //   537: goto -235 -> 302
    //   540: lload 9
    //   542: lstore 31
    //   544: goto -235 -> 309
    //   547: aload 11
    //   549: astore 23
    //   551: aload 12
    //   553: astore 24
    //   555: lload 9
    //   557: lstore 16
    //   559: aload 23
    //   561: astore 18
    //   563: aload 24
    //   565: astore 19
    //   567: goto -228 -> 339
    //
    // Exception table:
    //   from	to	target	type
    //   80	102	438	java/lang/Throwable
    //   102	169	438	java/lang/Throwable
    //   174	213	438	java/lang/Throwable
    //   216	234	438	java/lang/Throwable
    //   242	291	438	java/lang/Throwable
    //   377	431	438	java/lang/Throwable
    //   0	36	492	java/lang/Throwable
    //   36	65	492	java/lang/Throwable
    //   460	469	492	java/lang/Throwable
    //   309	320	494	java/lang/Throwable
    //   320	327	511	java/lang/Throwable
    //   339	354	528	java/lang/Throwable
  }

  private boolean b(String paramString)
  {
    try
    {
      File localFile = new File(paramString);
      localFile.delete();
      localFile.createNewFile();
      return true;
    }
    catch (Throwable localThrowable)
    {
      MobLog.getInstance().d(localThrowable);
    }
    return false;
  }

  private long c()
  {
    long l1 = a.b(this.c);
    try
    {
      File localFile = new File(R.getCacheRoot(this.c), "comm/dbs/.nulplt");
      if (!localFile.getParentFile().exists())
        localFile.getParentFile().mkdirs();
      if (localFile.exists())
      {
        DataInputStream localDataInputStream = new DataInputStream(new FileInputStream(localFile));
        long l2 = localDataInputStream.readLong();
        localDataInputStream.close();
        return l2;
      }
      localFile.createNewFile();
      d();
      return l1 + 86400000L;
    }
    catch (Throwable localThrowable)
    {
      MobLog.getInstance().d(localThrowable);
    }
    return l1 + 86400000L;
  }

  private long d()
  {
    long l = 86400000L + a.b(this.c);
    try
    {
      File localFile = new File(R.getCacheRoot(this.c), "comm/dbs/.nulplt");
      if (!localFile.getParentFile().exists())
        localFile.getParentFile().mkdirs();
      DataOutputStream localDataOutputStream = new DataOutputStream(new FileOutputStream(localFile));
      localDataOutputStream.writeLong(l);
      localDataOutputStream.flush();
      localDataOutputStream.close();
      return l;
    }
    catch (Throwable localThrowable)
    {
      MobLog.getInstance().d(localThrowable);
    }
    return 0L;
  }

  private HashMap<String, String[]> e()
  {
    ArrayList localArrayList = this.d.getInstalledApp(false);
    HashMap localHashMap1 = new HashMap();
    Iterator localIterator = localArrayList.iterator();
    while (localIterator.hasNext())
    {
      HashMap localHashMap2 = (HashMap)localIterator.next();
      String str = (String)localHashMap2.get("pkg");
      String[] arrayOfString = new String[2];
      arrayOfString[0] = ((String)localHashMap2.get("name"));
      arrayOfString[1] = ((String)localHashMap2.get("version"));
      localHashMap1.put(str, arrayOfString);
    }
    return localHashMap1;
  }

  public static void startCollector(Context paramContext)
  {
    try
    {
      if (b == null)
      {
        b = new RuntimeCollector(paramContext);
        b.a();
      }
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public static void startCollector(Context paramContext, String paramString)
  {
    try
    {
      startCollector(paramContext);
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.mob.commons.appcollector.RuntimeCollector
 * JD-Core Version:    0.6.2
 */